<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://code.jquery.com/jquery-latest.js"></script>
<title>Insert title here</title>
<script type="text/javascript">
$(document).ready(function(){
	
	$("#writeBtn").on("click",function(){
		var title = $("#title").val();
		if(title==""){
			alert("제목을 입력해주세요.");
			return;
		}
		
		var content = $("#content").val();
		if(content==""){
			alert("내용를 입력해주세요.");
			return;
		}
		
		var flag=confirm("글작성을 완료 하시겠습니까?");
		
		 if(flag){
			 var f = $("#write_form");
			 f.submit();
		 }
	});
});
</script>
</head>
<body>
<font face="HY나무L" size="5"><strong>글쓰기 <br><br></strong></font>

  <form action="./gallery.do" method="post" id="write_form">
  <input type="hidden" name="mode" value="write">
  <input type="hidden" name="category" value="${param.category }">
  

   <table width="550px" >
    <tr>
     <td width="10%">제목</td>
     <td colspan="3">
     <input type="text" id="title" maxlength="200" size="50" name="title">
     </td>
    </tr>

    <tr>

     <td colspan="4">
     <textarea cols="80" rows="20" id="content" name="contents"></textarea>
     </td>
    </tr> 
    <tr>
     <td colspan="2" align="right" >
      <img src="../img/write_btn.jpg" alt="글입력" style="cursor:hand"
     id="writeBtn">

     </td>
  
    </tr>
   </table>
  </form>
</body>
</html>